import React from "react";
import { BrowserRouter as Router, Navigate } from "react-router-dom";

// 导入页面组件
import Login from "../pages/Login";
import Layout from "../components/Layout";

// 后台页面
import Home from "../pages/Dashboard/Home/Home";

// 医院综合
import DepartmentManagement from "../pages/Dashboard/HospitalComprehensive/DepartmentManagement";
import AddDepartment from "../pages/Dashboard/HospitalComprehensive/AddDepartment";

// 患者数据
import DrugMaterialStats from "../pages/Dashboard/PatientData/DrugMaterialStats";
import DiseaseData from "../pages/Dashboard/PatientData/DiseaseData";

// 动态个人
import RegistrationManagement from "../pages/Dashboard/DynamicPersonal/RegistrationManagement";

// 中西医药房
import PrescriptionManagement from "../pages/Dashboard/TraditionalWesternPharmacy/PrescriptionManagement";
import RevenueData from "../pages/Dashboard/TraditionalWesternPharmacy/RevenueData";
import PharmacyStatistics from "../pages/Dashboard/TraditionalWesternPharmacy/PharmacyStatistics";

// 医疗前线
import PrescriptionIssuance from "../pages/Dashboard/MedicalFrontline/PrescriptionIssuance";
import PrescriptionManagementFrontline from "../pages/Dashboard/MedicalFrontline/PrescriptionManagement";
import MedicalEquipmentStatistics from "../pages/Dashboard/MedicalFrontline/MedicalEquipmentStatistics";

// 医疗药品出入库
import MedicalItemsManagement from "../pages/Dashboard/MedicalPharmacyStorage/MedicalItemsManagement";
import AddDrugMaterial from "../pages/Dashboard/MedicalPharmacyStorage/AddDrugMaterial";

// 分级医生
import ScheduleManagementDoctor from "../pages/Dashboard/GradedDoctor/ScheduleManagement";
import DoctorList from "../pages/Dashboard/GradedDoctor/DoctorList";
import PersonalInfoDoctor from "../pages/Dashboard/GradedDoctor/PersonalInfo";

// 分级护士
import ScheduleManagementNurse from "../pages/Dashboard/GradedNurse/ScheduleManagement";
import NurseList from "../pages/Dashboard/GradedNurse/NurseList";
import PersonalInfoNurse from "../pages/Dashboard/GradedNurse/PersonalInfo";

// 病床管理
import AddBed from "../pages/Dashboard/BedManagement/AddBed";
import BedList from "../pages/Dashboard/BedManagement/BedList";

// 账号管理
import AccountList from "../pages/Dashboard/AccountManagement/AccountList";
import AddAccount from "../pages/Dashboard/AccountManagement/AddAccount";

const routes = [
  { path: "/login", element: <Login /> },
  { path: "/", element: <Navigate to="/login" /> },
  {
    path: "/dashboard",

    element: <Layout />,
    children: [
      { path: "", element: <Navigate to="home" /> },
      { path: "home", element: <Home />, meta: { type: "首页" } },
      {
        path: "hospital-comprehensive/department-management",
        element: <DepartmentManagement />,
        meta: { type: "医院综合", typeChildren: "科室管理" },
      },
      {
        path: "hospital-comprehensive/add-department",
        element: <AddDepartment />,
        meta: { type: "医院综合", typeChildren: "添加科室" },
      },
      {
        path: "patient-data/drug-material-stats",
        element: <DrugMaterialStats />,
        meta: { type: "患者大数据", typeChildren: "药品耗材统计" },
      },
      {
        path: "patient-data/disease-data",
        element: <DiseaseData />,
        meta: { type: "患者大数据", typeChildren: "疾病大数据" },
      },
      {
        path: "dynamic-personal/registration-management",
        element: <RegistrationManagement />,
        meta: { type: "动态个人", typeChildren: "挂号管理" },
      },
      {
        path: "traditional-western-pharmacy/prescription-management",
        element: <PrescriptionManagement />,
        meta: { type: "中西医药房", typeChildren: "处方综合管理" },
      },
      {
        path: "traditional-western-pharmacy/revenue-data",
        element: <RevenueData />,
        meta: { type: "中西医药房", typeChildren: "营收数据表" },
      },
      {
        path: "traditional-western-pharmacy/pharmacy-statistics",
        element: <PharmacyStatistics />,
        meta: { type: "中西医药房", typeChildren: "药房统计" },
      },
      {
        path: "medical-frontline/prescription-issuance",
        element: <PrescriptionIssuance />,
        meta: { type: "医疗前线", typeChildren: "处方开具" },
      },
      {
        path: "medical-frontline/prescription-management",
        element: <PrescriptionManagementFrontline />,
        meta: { type: "医疗前线", typeChildren: "处方综合管理" },
      },
      {
        path: "medical-frontline/equipment-statistics",
        element: <MedicalEquipmentStatistics />,
        meta: { type: "医疗前线", typeChildren: "医疗器材统计" },
      },
      {
        path: "medical-pharmacy-storage/medical-items-management",
        element: <MedicalItemsManagement />,
        meta: { type: "医疗药品出入库", typeChildren: "医疗用品综合管理" },
      },
      {
        path: "medical-pharmacy-storage/add-drug-material",
        element: <AddDrugMaterial />,
        meta: { type: "医疗药品出入库", typeChildren: "添加药品耗材" },
      },
      {
        path: "graded-doctor/schedule-management",
        element: <ScheduleManagementDoctor />,
        meta: { type: "分级医生", typeChildren: "排班管理" },
      },
      {
        path: "graded-doctor/doctor-list",
        element: <DoctorList />,
        meta: { type: "分级医生", typeChildren: "医生综合列表" },
      },
      {
        path: "graded-doctor/personal-info",
        element: <PersonalInfoDoctor />,
        meta: { type: "分级医生", typeChildren: "修改个人信息" },
      },
      {
        path: "graded-nurse/schedule-management",
        element: <ScheduleManagementNurse />,
        meta: { type: "分级护士", typeChildren: "排班管理" },
      },
      {
        path: "graded-nurse/nurse-list",
        element: <NurseList />,
        meta: { type: "分级护士", typeChildren: "护士综合列表" },
      },
      {
        path: "graded-nurse/personal-info",
        element: <PersonalInfoNurse />,
        meta: { type: "分级护士", typeChildren: "修改个人信息" },
      },
      {
        path: "bed-management/add-bed",
        element: <AddBed />,
        meta: { type: "病床管理", typeChildren: "添加床位" },
      },
      {
        path: "bed-management/bed-list",
        element: <BedList />,
        meta: { type: "病床管理", typeChildren: "床位综合管理" },
      },
      {
        path: "account-management/account-list",
        element: <AccountList />,
        meta: { type: "全账号管理", typeChildren: "账号管理" },
      },
      {
        path: "account-management/add-account",
        element: <AddAccount />,
        meta: { type: "全账号管理", typeChildren: "添加账号" },
      },
    ],
  },
];
export default routes;
